﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NetworkPower.Data.Models.Mapping
{
    public class LoopLineMap : EntityTypeConfiguration<LoopLine>
    {
        public LoopLineMap()
        {
            // Primary Key
            this.HasKey(t => new { t.LoopLineId });

            // Properties
            this.Property(t => t.TerminalNo)
               .IsRequired();

            // Table & Column Mappings
            this.ToTable("LoopLines");
            this.Property(t => t.LoopLineId).HasColumnName("LoopLineId");
            this.Property(t => t.LoopLineName).HasColumnName("LoopLineName");
            this.Property(t => t.LoopLineNameColor).HasColumnName("LoopLineNameColor");
            this.Property(t => t.InternalLine).HasColumnName("InternalLine");
            this.Property(t => t.TerminalNo).HasColumnName("TerminalNoText");
            this.Property(t => t.TerminalNoColor).HasColumnName("TerminalNoColor");
            this.Property(t => t.OuterLine).HasColumnName("OuterLine");
            this.Property(t => t.RowIndex).HasColumnName("RowIndex");
            this.Property(t => t.IsMatched).HasColumnName("IsMatch");
            this.Property(t => t.LoopNo).HasColumnName("LoopNo");
        }
    }
}
